//
//  HLPaymentController.m
//  Objective-cDemo
//
//  Created by ShareAnimation on 2019/8/23.
//  Copyright © 2019 爱丽丝的梦境. All rights reserved.
//

#import "HLPaymentController.h"
#import "Masonry.h"
#import "SBPasswordTextField.h"
@interface HLPaymentController ()<SBPasswordTextFieldDelegate>

@property (strong, nonatomic) SBPasswordTextField *passwordField;
@end

@implementation HLPaymentController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.shadowImage = [UIImage new];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"取消" style:UIBarButtonItemStyleDone target:self action:@selector(doBackAction)];
    
    [self setupViews];
}

- (void)setupViews {
    UILabel *paymentTitleLabel = [UILabel new];
    paymentTitleLabel.text = @"添加银行卡";
    paymentTitleLabel.font = [UIFont systemFontOfSize:26];
    [self.view addSubview:paymentTitleLabel];
    [paymentTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.equalTo(self.view).offset(150);
    }];
    
    UILabel *guideLabel = [UILabel new];
    guideLabel.text = @"请输入支付密码，以验证身份";
    [self.view addSubview:guideLabel];
    [guideLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(paymentTitleLabel.mas_bottom).offset(15);
        make.centerX.equalTo(paymentTitleLabel);
    }];
    
    SBPasswordTextField *passwordField = [[SBPasswordTextField alloc] init];
    passwordField.delegate = self;
    self.passwordField = passwordField;
    [self.view addSubview:passwordField];
    [passwordField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(30);
        make.right.equalTo(self.view).offset(-30);
        make.height.equalTo(@50);
        make.top.equalTo(guideLabel.mas_bottom).offset(60);
    }];
}


- (void)passwordTextChange:(NSString *)text {
    NSLog(@"%@",text);
}

- (void)doBackAction {
    [self.navigationController popViewControllerAnimated:true];
}
@end
